﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DataService;

namespace AdventureIreland_2._0.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Message = "Welcome to ASP.NET MVC!";

            return View();
        }

        public ActionResult About()
        {
            return View();
        }

        public ActionResult InsertProvince()
        {
            Service1 dataService = new Service1();
            Province leinster = new Province() { NameImpl = "Leinster" };
            dataService.InsertProvince(leinster);
            return View("Index");
        }

        public ActionResult DeleteProvince()
        {
            int id = 1;
            Service1 dataService = new Service1();
            Province leinster = dataService.GetProvince(new Province(){ ProvinceIdImpl = id});
            dataService.DeleteProvince(leinster);
            return View("Index");
        }
    }
}
